<%- partial('serial/tbar') %> 
<!-- 代码片段 分页控件 -->
<!-- 代码片段 查询结果 -->
<div class="span12">
  <table class="table table-hover table-striped">
    <thead>
      <tr>
        <th>流水号</th>
        <th>会员</th>
        <th>日期</th>
        <th>项目</th>
        <th>折扣</th>
        <th>消费</th>
        <th>余额</th>
        <th>美甲师</th>
      </tr>
    </thead>
    <tbody>
      <% locals.serials.forEach(function(s,index){ %>      
      <tr>
        <td><%= s.id %></td>
        <td><%= s.vip %></td>
        <td><%= s.date.format('yyyy-MM-dd hh:mm') %></td>
        <td><%= s.project %></td>
        <td><%= s.discount %></td>
        <td><%= s.price %></td>
        <td><%= s.balance %></td>
        <td><%= s.artist %></td>
        <td>
          <a href="javascript:void(0)" title="删除流水"  onclick="delConfirm('/serialdel/<%= s.id %>','确定要删除这条流水吗？');" class="btn btn-default"><span class="glyphicon glyphicon-minus"></span></a>
        </td>
      </tr>
      <% }); %>
    </tbody>
  </table>
  <ul class="pagination">
    <li><a href="/serial/query?num=1">&laquo;</a></li>
    <%
    var first = Math.max(1,locals.num - 5);
    var end = Math.min(locals.pageCount,Number(locals.num) + 5);
    if(first > 1) {
    %>
    <li><a href="/serial/query?num=<%= first-1 %>">...</a></li>
    <%}
    for(var i = first ; i <= end ; i++ ) {
    if(locals.num == i) { %>
    <li class="active"><a href="/serial/query?num=<%= i %>"><%= i %></a></li>
    <% } else{ %>
    <li><a href="/serial/query?num=<%= i %>"><%= i %></a></li>
    <% }}
    if(end < locals.pageCount) {
    %>
    <li><a href="/serial/query?num=<%= end + 1 %>">...</a></li>
    <%}%>
    <li><a href="/serial/query?num=<%= locals.pageCount%>">&raquo;</a></li>
  </ul>
</div>

<script src="/js/serial.js"></script>
